package homework;

import java.util.Scanner;

public class Java语言基础3 {

	public static void main(String[] args) {
		int num,g,s,b,q;
		System.out.println("请输入一个四位数正整数：");
		Scanner k = new Scanner(System.in);
		num = k.nextInt();
		q=num/1000;
		b=(num-1000*q)/100;
		s=(num-1000*q-100*b)/10;
		g=num%10;
		System.out.println("千位："+q+",百位："+b+",十位："+s+",个位："+g);
	}

}
